package cool.tianyou.blue.bird.module.auth.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import cool.tianyou.blue.bird.common.model.po.Device;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author Liutianyou
 * @date 2021/8/14 11:17 下午
 */
@Data
@AllArgsConstructor
public class LoginDTO {

  private String token;
  private Integer userId;
  private Integer deviceId;
  private Boolean disabled;
  private Boolean isNewDevice;
  @JSONField(serialize = false)
  private Device device;
  private Boolean pushState;

  public LoginDTO(String token, Device device, Boolean isNewDevice) {
    this.token = token;
    this.device = device;
    this.deviceId = device.getId();
    this.disabled = device.getDisabled();
    this.pushState = device.getPushState();
    this.userId = device.getUserId();
    this.isNewDevice = isNewDevice;

  }
}
